package com.dyw.mybatisplus04ar.entity;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * @author Devil
 * @create 2022-01-21-23:08
 *
 * 使用AR,要求实体类需要继承MP中的Model
 *Model中提供了对数据库的CRUD的操作
 */
@SuppressWarnings("all")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "people")
public class People extends Model<People> {
    //定义属性,属性名和表的列名一样
    @TableId(
            value = "pid",
            type = IdType.ASSIGN_UUID
    )
    @TableField(value = "pid")
    private String id;
    private String peopleName;
}
